﻿using Microsoft.AspNetCore.SignalR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace SignalRCoreTest.Hubs
{
    public class TestHub : Hub
    {
        public async Task SendMessage(string userName, string msg)
        {
           await Clients.All.SendAsync("onMessage",userName, msg);
        }

        public async Task GetPerson()
        {
            Person p = new Person()
            {
                id = "1",
                name = "glz",
                age = 12,
                group = "g1"
            };
            await Clients.All.SendAsync("setPerson", p);
        }
    }
}
